package com.app.conrtoller;

import com.app.domain.qzj.ResultJson;
import com.app.service.qzj.QzjService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.util.HtmlUtils;

/**
 * 鲁琦起重机接口
 */
@Slf4j
@RestController
@RequestMapping("/qzj")
public class QzjUploadController {
    @Value("${yj.qzj.serviceHost}")
    private String serviceHost;
    @Value("${yj.qzj.appid}")
    private String appid;
    @Value("${yj.qzj.appsecret}")
    private String appsecret;
    @Value("${yj.qzj.format}")
    private String format;
    @Value("${yj.qzj.method}")
    private String method;
    @Value("${yj.qzj.version}")
    private String version;
    @Autowired
    private QzjService qzjService;

    @RequestMapping("/upload")
    @ResponseBody
    public ResultJson upload(@RequestBody String data) throws InterruptedException {
        log.info("data: " + data);
        return qzjService.upload(serviceHost, appid, appsecret, format, method, version, data);
    }


}